<template>
	<div>
		<h1>列表页</h1>
		<div v-for="n in 10" :key="n">
			{{ n }}
			<button @click="gotoDetails(n)">跳转至详情页</button>
		</div>
	</div>
</template>
<script setup>
import { useRouter } from "vue-router"

const router = useRouter()

const gotoDetails = (id) => {
	router.push(`/details/${id}`)
}
</script>
